﻿<!DOCTYPE html>
<!--安全交底和风险告知确认卡-安全交底填报-->
<!--[by:wanglr]-->
<!--[date:2019-06-14]-->
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
        <script src="/static/js/common.js"></script>

    <link href="/static/js/vue-treeselect/vue-treeselect.css" rel="stylesheet" />
    <script src="/static/js/vue-treeselect/vue-treeselect.js"></script>
    <style>
        .vue-treeselect__control {
            height: 100%;
            border: none;
            background: none;
        }

        .vue-treeselect__placeholder {
            top: -3px;
        }

        .vue-treeselect__single-value {
            top: -3px;
        }
        body {
            padding-bottom: 10px;
        }
        .el-input__inner,.vue-treeselect{
            border: none!important
        }


    </style>
    <style>
        table {
            width: 100%;
            border-top: 1px solid;
            border-left: 1px solid;
            text-align: center;
            /*border-right: none;*/
        }
           .el-dialog__body{
   
         height:100%!important;
        }

        .el-dialog.is-fullscreen {
            overflow: hidden !important;
        }

            table td {
                border-right: 1px solid;
                border-bottom: 1px solid;
                /*height:38px;*/
                padding: 10px;
            }
        .el-table__header{
            border:none;
        }
        .el-table__body {
            border: none;
        }
        .el-table__body td{
            border: none;
        }
            .el-table__body table {
                border: none;
            }
    </style>

</head>
<body>
    
<div id="app" v-cloak>   
        <div style="width:100%;text-align:center ">
            <label style="font-weight:bold">{{SecurityAndRiskConfirmationCard.SafetyAndRisCard}}</label>
        </div>
        <div style="width:100%;text-align:right">
            <label>Q/G11-018-R01&nbsp;&nbsp;&nbsp;No.：{{id}}</label>
        </div>
        <el-form :model="Form" status-icon style="margin-top:5px;width:100%" :rules="rules" ref="ruleForm">

            <table cellpadding="0" cellspacing="0" style="">
                <tr><td width="10%">{{SecurityAndRiskConfirmationCard.OperatingUnit}}</td>
                    <td width="40%">
                        <div class="elst-select-mini">
                            <el-form-item>
                                <el-input size="mini">
                                    <el-select @visible-change="visibleChange" v-model="Form.OperatingUnit" slot="suffix" :placeholder="SecurityAndRiskConfirmationCard.OperatingUnit">
                                        <el-option label="请选择" value=""></el-option>
                                        <el-option v-for="item in OperatingUnit" :label="item.value" :value="item.key">
                                        </el-option>
                                    </el-select>
                                </el-input>
                            </el-form-item>
                        </div>
                    </td>
                <td width="10%">{{SecurityAndRiskConfirmationCard.WorkshopProjectLeader}}</td>
                <td width="40%">
                    <div class="elst-select-mini">
                        <el-form-item>
                            <el-input size="mini">
                                <el-select @visible-change="visibleChange" v-model="Form.WorkshopProjectLeader" slot="suffix" :placeholder="SecurityAndRiskConfirmationCard.WorkshopProjectLeader">
                                    <el-option label="请选择" value=""></el-option>
                                    <el-option v-for="item in WorkshopProjectLeader" :label="item.value" :value="item.key">
                                    </el-option>
                                </el-select>
                            </el-input>
                        </el-form-item>
                    </div>
                </td>
                </tr>
                <tr><td>{{SecurityAndRiskConfirmationCard.JobContent}}</td><td colspan="3">
                            <div class="elst-select-mini">
                                <el-form-item>
                                    <el-input type="text" v-model="Form.JobContent" autocomplete="off" size="mini">
                                     

                                    </el-input>
                                </el-form-item>
                            </div>
                        </td></tr>
                <tr><td>{{SecurityAndRiskConfirmationCard.JobTime}}</td><td colspan="3">
                    从                     <el-date-picker v-model="Form.JobTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
                                                          placeholder="选择时间">
                    </el-date-picker>至  <el-date-picker v-model="Form.JobTimeEnd" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
                                                        placeholder="选择时间">
                    </el-date-picker>
                </td></tr>
                <tr>
                    <td>{{SecurityAndRiskConfirmationCard.JobPerson}}</td>
                    <td colspan="3">
                        <treeselect v-model="Form.JobPerson" :options="JobPerson" :flat="true"
                                    :show-count="true" :disable-branch-nodes="true" placeholder="请选择"
                                    style="line-height: 28px;border:1px solid #ccc;border-radius:5px;" />
                    </td>
                </tr>
                <tr><td colspan="4">{{SecurityAndRiskConfirmationCard.BaseRequire}}</td></tr>
                <tr><td colspan="4" style="text-align:left;">{{SecurityAndRiskConfirmationCard.Instructions1}}</td></tr>
            </table>
            <table cellpadding="0" cellspacing="0" style="border-top:none;">
                <!--<td width="7%" rowspan="6">{{SecurityAndRiskConfirmationCard.SafetyAndRiskContent}}</td>-->
                <tr>
                    <td width="7%">{{SecurityAndRiskConfirmationCard.ScopeAndEnvironment}}</td>
                    <td width="86%">
                        <div class="elst-select-mini">
                            <el-form-item>
                                <el-input type="text" v-model="Form.ScopeAndEnvironment" autocomplete="off" size="mini">
                                </el-input>
                            </el-form-item>
                        </div>
                    </td>
                </tr>


                <tr>
                    <!--跳多个风险添加步骤-->
                    <!--<td colspan="2">{{SecurityAndRiskConfirmationCard.SafetyAndRiskContent}}&nbsp;&nbsp;&nbsp;<a href="javascript:void(0)" @click="Riskstep('tj')">添加</a></td>-->
                    <!--风险识别及安全措施: 只跳检维修作业活动 作业活动等于作业步骤-->
                    <td colspan="2">{{SecurityAndRiskConfirmationCard.SafetyAndRiskContent}}&nbsp;&nbsp;&nbsp;<a href="javascript:void(0)" @click="MaintenanceActivities('tj')">添加</a></td>
                </tr>
                <!--<tr><td width="7%">{{SecurityAndRiskConfirmationCard.PreventiveMeasures}}</td><td width="86%"><el-link type="primary" underline="false" style="color: #409eff;cursor:pointer;" @click="DialogInput">{{col.btnSetting}}</el-link></td></tr>-->
               <tr>
                   <td colspan="2">
                       <!--跳多个风险添加步骤-->
                       <!--<el-table :data="Form.RiskIdentificationSafety" style="width: 100%;margin-bottom: 20px; border:0px solid"
              row-style="height:10px;" >
        <el-table-column type="expand">
            <template slot-scope="props">
                <el-form label-position="left" inline class="demo-table-expand">
                    <table style=" width:100%; " cellpadding="0" cellspacing="0">
                        <thead>
                            <tr>
                                <td style="text-align:center">{{JSPAnalyticalManagement.Risk}}</td>
                                <td style=" text-align:center">{{JSPAnalyticalManagement.HazardousFactors}}</td>
                                <td style=" text-align:center">{{JSPAnalyticalManagement.ControlRequirements}}</td>
                            </tr>
                        </thead>
                        <tbody v-for="todo in props.row.List">
                            <tr>
                                <td style=" text-align:center">{{todo.Risk}}</td>
                                <td style=" text-align:center">{{todo.HazardousFactors}}</td>
                                <td style=" text-align:center">{{todo.ControlRequirement}}</td>
                            </tr>
                        </tbody>
                    </table>
                </el-form>
            </template>
        </el-table-column>
        <el-table-column prop="RiskStepsName"
                         :label="JSPAnalyticalManagement.WorkProcedure">
        </el-table-column>
    </el-table>-->
                       <!--风险识别及安全措施: 只跳检维修作业活动 作业活动等于作业步骤-->
                       <el-table :data="Form.RiskIdentificationSafety" style="width: 100%;margin-bottom: 20px;" border
                                 row-style="height:10px">
                           <el-table-column type="index" :label="JobLicenseManagement.SerialNumber"
                                            :index="indexMethod" width="50" show-overflow-tooltip="true"></el-table-column>
                           <el-table-column prop="RiskStepsName"
                                            :label="JSPAnalyticalManagement.WorkProcedure">
                           </el-table-column>
                           <el-table-column prop="Risk"
                                            :label="JSPAnalyticalManagement.Risk">
                           </el-table-column>
                           <el-table-column prop="HazardousFactors"
                                            :label="JSPAnalyticalManagement.HazardousFactors">
                           </el-table-column>
                           <el-table-column prop="ControlRequirement"
                                            :label="JSPAnalyticalManagement.ControlRequirements">
                           </el-table-column>
                           <el-table-column label="操作">
                               <template slot-scope="scope">
                                   <el-button @click.native.prevent="deleteRow(scope.$index, Form.RiskIdentificationSafety)"
                                              type="text"
                                              size="small">
                                       移除
                                   </el-button>
                               </template>
                           </el-table-column>
                       </el-table>
                   </td>
               </tr>
                
                <tr>
                    <td width="7%">{{SecurityAndRiskConfirmationCard.EmergencyMeasure}}</td>
                    <td width="86%">
                        <div class="elst-select-mini">
                            <el-form-item>
                                <el-input type="text" v-model="Form.EmergencyMeasure" autocomplete="off" size="mini">
                                </el-input>
                            </el-form-item>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td width="7%">{{SecurityAndRiskConfirmationCard.OtherConsiderations}}</td>
                    <td width="86%">
                        <div class="elst-select-mini">
                            <el-form-item>
                                <el-input type="text" v-model="Form.OtherConsiderations" autocomplete="off" size="mini">
                                </el-input>
                            </el-form-item>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td width="7%">{{SecurityAndRiskConfirmationCard.SignatureOfLeader}}</td>
                    <td width="86%">

                        <treeselect v-model="Form.SignatureOfLeader" :options="SignatureOfLeader" :flat="true"
                                    :show-count="true" :disable-branch-nodes="true" placeholder="请选择"
                                    style="line-height: 28px;border:1px solid #ccc;border-radius:5px;" />
                    </td>
                </tr>
            </table>
            <table cellpadding="0" cellspacing="0" style="border-top:none;">
                <tr>
                    <td width="10%">{{SecurityAndRiskConfirmationCard.SceneLeader}}</td>
                    <td width="90%">
                        {{SecurityAndRiskConfirmationCard.Instructions2}}<br />
                        <treeselect v-model="Form.SceneLeader" :options="SceneLeader" :flat="true"
                                    :show-count="true" :disable-branch-nodes="true" placeholder="请选择"
                                    style="line-height: 28px;border:1px solid #ccc;border-radius:5px;" />
                    </td>
                </tr>
            </table>
            <el-row>
                <el-form-item style="text-align:center; padding-top:5px">
                    <el-button type="primary" @click="onSubmitForm('ruleForm')">{{col.btnSave}}</el-button>
                    <el-button type="primary" @click="parent.ListItem.dialogVisible=false">{{col.btnBack}}</el-button>
                </el-form-item>
            </el-row>
        </el-form>
        <el-dialog :title="DialogTitle" :visible.sync="ListItem.dialogVisible" width="80%" height="80%" top="10vh" fullscreen="true">
            <iframe ref="iframe" :src="ListItem.InputUrl" style="height:95%;width:100%" frameborder="0"></iframe>
        </el-dialog>
    </div>
    <script type="text/javascript">

        app = new Vue({
            el: '#app',
            data: {
                id: '',
                DialogTitle: '',
                mydata: PersonInChargeTree,
                ListItem: ListItem,
                Form: {
                    id: guidEmpty,
                    OperatingUnit: '',
                    WorkshopProjectLeader: '',
                    JobTime: '',
                    JobTimeEnd:'',
                    JobContent: '',
                    ScopeAndEnvironment: '',
                    OperationalRisk:'',
                    JobPerson: null,
                    SignatureOfLeader: null,
                    SceneLeader: null,
                    RiskIdentificationSafety:[],
                },
                JobPerson: [],//作业人员
                SignatureOfLeader: [],//单位负责人签字
                SceneLeader: [],//作业单位现场负责人
                rules: {},
                OperatingUnit: [],
                WorkshopProjectLeader: [],
                OperationalRisk:[],
            },
            methods: {
                //解決edge下select bug
                visibleChange: function (isVisible) {
                    visibleChange(isVisible)
                },
                indexMethod: function (index) {
                    return (this.ListItem.currentPage - 1) * this.ListItem.pagesize + index + 1;
                },
                getData: function () {
                    getData(this, '/api/SecurityAndRiskConfirmationCard/get?id=' + this.id);
                },
                deleteRow: function (index, rows) {
                    rows.splice(index, 1);
                },
                //只跳检维修作业活动 作业活动等于作业步骤
                MaintenanceActivities: function (val, id) {
                    this.DialogTitle = "风险识别及安全措施管理";
                    DialogShow(this, val, "../StasRiskControlInformationDatabase/MaintenanceActivitiesList.html", id);
                },

                DialogInput: function () {
                    this.DialogTitle = "防护措施设置";
                    DialogShow(this, 'xg', "ProtectiveSetting.html", this.id);
                },
                Riskstep: function (val, id) {
                    this.DialogTitle = "风险识别及安全措施管理";
                    DialogShow(this, val, "../GeneralLiftingWorkSafety/RiskstepsInformationBaseList.html", id);
                },
                //提交数据
                onSubmitForm: function (formName) {
                    var mythis = this;
                    this.$refs[formName].validate(function (valid) {
                        //验证通过
                        if (valid) {
                            onSubmitForm(this, '/api/SecurityAndRiskConfirmationCard/Save', mythis.Form);
                        } else {
                            //验证失败
                            return false;
                        }
                    });
                },
            },
            mounted: function () {
                var list = getDicDataArray([ '22', '09', '08']);
                this.OperatingUnit = getDicDatafromArray('08', list);
                this.WorkshopProjectLeader = getDicDatafromArray('09', list);
                this.OperationalRisk = getDicDatafromArray('22', list);
                this.JobPerson = fn(this.mydata, "0");
                this.SignatureOfLeader = fn(this.mydata, "0");
                this.SceneLeader = fn(this.mydata, "0");
                this.id = getUrlParam("id");
                this.getData();

            }
        });
    </script>
</body>
</html>